/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.servinf.ani.sincronizador.entities;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author mortiz
 */
@Entity
@Table(catalog = "ani_admin", schema = "public")
@NamedQueries({
    @NamedQuery(name = "Area.findAll", query = "SELECT a FROM Area a")})
public class Area implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "id_area")
    private Integer idArea;
    @Column(name = "nombre_area")
    private String nombreArea;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "areaEncargada")
    private List<Intervencion> intervencionList;
    @OneToMany(mappedBy = "idArea")
    private List<ServiciosXArea> serviciosXAreaList;

    public Area() {
    }

    public Area(Integer idArea) {
        this.idArea = idArea;
    }

    public Integer getIdArea() {
        return idArea;
    }

    public void setIdArea(Integer idArea) {
        this.idArea = idArea;
    }

    public String getNombreArea() {
        return nombreArea;
    }

    public void setNombreArea(String nombreArea) {
        this.nombreArea = nombreArea;
    }

    public List<Intervencion> getIntervencionList() {
        return intervencionList;
    }

    public void setIntervencionList(List<Intervencion> intervencionList) {
        this.intervencionList = intervencionList;
    }

    public List<ServiciosXArea> getServiciosXAreaList() {
        return serviciosXAreaList;
    }

    public void setServiciosXAreaList(List<ServiciosXArea> serviciosXAreaList) {
        this.serviciosXAreaList = serviciosXAreaList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idArea != null ? idArea.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Area)) {
            return false;
        }
        Area other = (Area) object;
        if ((this.idArea == null && other.idArea != null) || (this.idArea != null && !this.idArea.equals(other.idArea))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.servinf.ani.sincronizador.entities.Area[ idArea=" + idArea + " ]";
    }
    
}
